home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1998 February
/
Macworld (1998-02).dmg
/
Inside Macworld
/
Alphamania 2 & Effector Sets
/
AlphaMania 2
/
Set FX.dir
/
00111_Script_Radio Button
< prev
next >
Wrap
Text File
|
1997-12-19
|
2KB
|
90 lines
property pSpriteList, pCurActive, pActive, pCallBackObj, pRefcon
on new me, propList
set pSpriteList = getAProp(propList,#sprites)
set pCurActive = getAProp(propList,#cur)
set pActive = getAProp(propList,#active)
set pCallBackObj = getAProp(propList,#callback)
set pRefcon = getAProp(propList,#ref)
SetActive(me, pCurActive)
if pCurActive > count(pSpriteList) then set pCurActive = 0
return(me)
end
on Click me, sNum
if not pActive then exit
if not integerP(sNum) then set sNum = the clickOn
if the memberNum of sprite sNum < 1 then exit
if not (the name of the member of sprite sNum contains "radioButton") then exit
put the name of the member of sprite sNum into memName
set the member of sprite sNum = member (memName&&"Down")
updateStage
set selected = TRUE
repeat while the stillDown
if rollover(sNum) then
set the member of sprite sNum = member (memName&&"Down")
set selected = TRUE
else
set the member of sprite sNum = member (memName)
set selected = FALSE
end if
updateStage
end repeat
put getPos(pSpriteList,sNum) into newNum
SetActive(me,newNum)
if objectP(pCallBackObj) then
RadioClick(pCallBackObj, pRefcon, pCurActive)
end if
return(pCurActive)
end
on SetActive me, newNum
set pCurActive = newNum
repeat with i = 1 to count(pSpriteList)
put getAt(pSpriteList,i) into sNum
puppetSprite sNum, TRUE
if i = pCurActive then
set the member of sprite sNum = member "radioButton 1"
else
set the member of sprite sNum = member "radioButton 0"
end if
end repeat
--updateStage
end
on SetEnabled me, enabled
set pActive = enabled
repeat with i in pSpriteList
enableInterfaceElement(i,enabled)
end repeat
end
on ThisYou me, sNum
repeat with i = 1 to count(pSpriteList)
if(getAt(pSpriteList, i) = sNum) then
return TRUE
end if
end repeat
return FALSE
end
on GetActiveRadio me
return(pCurActive)
end
on Release me
repeat with i = 1 to count(pSpriteList)
puppetSprite getAt(pSpriteList,i), FALSE
end repeat
end